#ifndef	_GLOBAL_H_
#define	_GLOBAL_H_

#include <HT45F3230.h>

typedef	unsigned char	uint8;
#define u8  uint8
#define uint8_t uint8
typedef	volatile unsigned char vuint8;
typedef	char			int8;
typedef	volatile char	vint8;
typedef	unsigned int	uint16;
#define u16 uint16
#define uint16_t uint16
typedef	volatile unsigned int	vuint16;
typedef	int				int16;
typedef volatile int	vint16;

typedef struct 
{
    uint8 b0:1;
    uint8 b1:1;
    uint8 b2:1;
    uint8 b3:1;
    uint8 b4:1;
    uint8 b5:1;
    uint8 b6:1;
    uint8 b7:1;
}TYPEDEF_BIT;


#define		YES		1
#define		NO		0

#define     TRUE    1
#define		FALSE	0

#define		HIGH	1
#define		LOW		0

#define		NULL	0

#ifdef	_GLOBAL_VAR_
#define	EXTERN
#else
#define	EXTERN	extern
#endif

/*---------- System Clock Configurations --------------------------------------------*/
#define		FSYS4MHZ 			0						/* system clock = 4MHZ */
#define		FSYS8MHZ			1						/* system clock = 8MHZ */
#define		FSYS12MHZ			2						/* system clock = 12MHZ */

#define		SYSTEM_CLOCK		FSYS8MHZ


#define P_TEST1     _pb0
#define P_TEST2     _pb1
#define P_TEST3     _pb2

#define P_KEY       _pb7


EXTERN uint16   AdcTXOFF;
EXTERN uint16   AdcTXON;

EXTERN uint8    LedSel;
#endif